<?php if (!defined('THINK_PATH')) exit();?><!doctype html>
<html>
    <head>
            <meta charset="utf-8">
            <title>升级</title>
            <meta http-equiv="Content-type" content="text/html; charset=utf-8">
            <meta http-equiv="X-UA-Compatible" content="IE=edge">
            <meta http-equiv="Cache-Control" content="no-transform" />
            <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" />
            <meta name="apple-mobile-web-app-status-bar-style" content="black">
            <meta name="renderer" content="webkit">
            <!--uc浏览器判断到页面上文字居多时，会自动放大字体优化移动用户体验。添加以下头部可以禁用掉该优化-->
            <meta name="wap-font-scale" content="no">
            <meta content="telephone=no" name="format-detection"/>
            <META HTTP-EQUIV="Pragma" CONTENT="no-cache">
            <link rel="stylesheet" type="text/css" href="/majiang/Public/home/css/mian.css"/>
            <script type="text/javascript" src="/majiang/Public/home/js/jquery-1.10.2.min.js"></script>
            <script src="/majiang/Public/home/js/html5.js" type="text/javascript" charset="utf-8"></script>
            <script>
            	 (function (doc, win) {
					var docEl = doc.documentElement,
					resizeEvt = 'orientationchange' in window ? 'orientationchange' : 'resize',         
					recalc = function () {
					  var clientWidth = docEl.clientWidth;
					  <!--
					  /*自加*/
					  clientWidth = document.documentElement ? document.documentElement.clientWidth : document.body.clientWidth;
					  if (clientWidth > 720) clientWidth = 720;
					  /*自加*/
					  -->
					  if (!clientWidth) return;
					  docEl.style.fontSize = 20 * (clientWidth / 720) + 'px';
					};
					  if (!doc.addEventListener) return;
					  win.addEventListener(resizeEvt, recalc, false);
					  doc.addEventListener('DOMContentLoaded', recalc, false);
				})(document, window);
				
				function showlevel(level_id){
					$("div[id^='level_info_']").each(function(){
						$(this).hide();
					});
					$("#level_info_"+level_id).show();
				}
            </script>
    </head>
    
    <body>
    	<style>
        	body{ background:#fff;}
        </style>
    	<div class="box">
            <header class="head">
            	<a href="<?php echo U('index/index');?>"></a>
                <h4>升级</h4>
            </header>
            <div class="shengji_bg">
                <div class="shengji_box">
                    <div class="shengji_top">
                        <i><img src="<?php echo ($user_info["avatar"]); ?>"></i>
                        <h4><?php echo ($user_info["nickname"]); ?></h4>
                        <span>级别：<?= $getagentlevel[$user_info['agentlevel']]?></span>
                    </div>
                    <div class="shengji_bot c" >
					<?php if(is_array($shengji)): $i = 0; $__LIST__ = $shengji;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$info): $mod = ($i % 2 );++$i;?><span <?php if($info['level_id'] == $user_info['agentlevel']): ?>class="link"<?php endif; ?> <?php if($summoney <= $info['level_money']): ?>onclick="showlevel(<?php echo ($info["level_id"]); ?>);"<?php endif; ?>>
                            <i></i>
                            <p><?php echo ($info["level_title"]); ?></p>
                        </span>
						<?php if($key+1 != count($shengji)): ?><strong></strong><?php endif; endforeach; endif; else: echo "" ;endif; ?>
                    </div>
                </div>
            </div>
            <div class="shengji_text">
				<?php if(is_array($uplevel)): $i = 0; $__LIST__ = $uplevel;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$level): $mod = ($i % 2 );++$i;?><div class="shengji_text_top c" id="level_info_<?php echo ($level["level_id"]); ?>" <?php if($key != 0): ?>style="display:none;"<?php endif; ?>>
                	<div style="width:100%;height:3rem;">
						<h4 style="width:auto;float:left;"><?= $getagentlevel[$level['level_id']]?>级别特权</h4>
						<?php if($level["upmoney"] > 0): ?><p data="<?php echo ($level["upmoney"]); ?>" level="<?php echo ($level["level_id"]); ?>" style="width:auto;float:left;color:#ff0000;">[需费用<?php echo ($level["upmoney"]); ?>可升级]</p><?php endif; ?>
					</div>
                    <p  style="width:100%;height:3rem;"><?php echo ($level["level_remarks"]); ?></p>		
                </div><?php endforeach; endif; else: echo "" ;endif; ?>
				<a onclick="shengjiact()">升级</a>
            </div>
        </div>
    </body>
	<script>
	function shengjiact(){
		var money=0;
		var level=0;
		$("div[id^='level_info_']").each(function(){
			if($(this).is(':visible')){
				money=$(this).find("p").attr("data");
				level=$(this).find("p").attr("level");
			}
		});
		if(money>0 && level>0){
			location.href="<?php echo (C("WEB_URL")); ?>index.php?m=Home&c=index&a=weixinpay&jine="+money+"&zt=2"+"&jibie="+level;
		}else{
			alert('参数错误');
		}
	}
	</script>
</html>